.class public Lcom/openfeint/internal/ui/WebViewCache;
.super Ljava/lang/Object;
.source "WebViewCache.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;,
        Lcom/openfeint/internal/ui/WebViewCache$ManifestData;,
        Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;,
        Lcom/openfeint/internal/ui/WebViewCache$ManifestRequest;,
        Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;,
        Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;,
        Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;
    }
.end annotation


# static fields
.field private static final ManifestRequestKey:Ljava/lang/String; = "manifest"

.field private static final OPENFEINT_ROOT:Ljava/lang/String; = "openfeint"

.field static final TAG:Ljava/lang/String; = "WebViewCache"

.field private static final WEBUI:Ljava/lang/String; = "webui"

.field private static diskError:Z = false

.field static final kBatchLoaded:I = 0x2

.field static final kBatchRetryDelayMillis:J = 0x1388L

.field static final kClientManifestReady:I = 0x3

.field static final kDataLoaded:I = 0x1

.field static final kNumBatchRetries:I = 0x3

.field static final kServerManifestReady:I

.field public static manifestProductOverride:Ljava/lang/String;

.field private static rootPath:Ljava/lang/String;

.field private static rootUri:Ljava/lang/String;

.field static sInstance:Lcom/openfeint/internal/ui/WebViewCache;

.field public static serverOverride:Ljava/net/URI;


# instance fields
.field appContext:Landroid/content/Context;

.field batchesAreBroken:Z

.field clientManifest:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field delegate:Lcom/openfeint/internal/ui/WebViewCacheCallback;

.field globalsFinished:Z

.field loadingFinished:Z

.field mDelayHandler:Landroid/os/Handler;

.field mHandler:Landroid/os/Handler;

.field pathsToLoad:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field prioritizedPaths:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

.field final serverURI:Ljava/net/URI;

.field trackedItems:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;",
            ">;"
        }
    .end annotation
.end field

.field trackedPaths:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 209
    const/4 v0, 0x0

    sput-boolean v0, Lcom/openfeint/internal/ui/WebViewCache;->diskError:Z

    .line 49
    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "_appContext"

    .prologue
    const/4 v0, 0x0

    .line 394
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 179
    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    .line 180
    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->globalsFinished:Z

    .line 186
    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->batchesAreBroken:Z

    .line 194
    invoke-static {}, Lcom/openfeint/internal/ui/WebViewCache;->getServerURI()Ljava/net/URI;

    move-result-object v0

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverURI:Ljava/net/URI;

    .line 395
    iput-object p1, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    .line 396
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    .line 397
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    .line 398
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    .line 399
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    .line 401
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->mDelayHandler:Landroid/os/Handler;

    .line 402
    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache$3;

    invoke-direct {v0, p0}, Lcom/openfeint/internal/ui/WebViewCache$3;-><init>(Lcom/openfeint/internal/ui/WebViewCache;)V

    iput-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    .line 428
    return-void
.end method

.method static synthetic access$0(Landroid/content/Context;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 789
    invoke-static {p0}, Lcom/openfeint/internal/ui/WebViewCache;->getManifestPath(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$1(Lcom/openfeint/internal/ui/WebViewCache;)V
    .locals 0
    .parameter

    .prologue
    .line 812
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->finishWithoutLoading()V

    return-void
.end method

.method static synthetic access$10(Lcom/openfeint/internal/ui/WebViewCache;I[BLjava/lang/String;Ljava/lang/String;ILjava/util/Set;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 870
    invoke-direct/range {p0 .. p6}, Lcom/openfeint/internal/ui/WebViewCache;->handleBatchBody(I[BLjava/lang/String;Ljava/lang/String;ILjava/util/Set;)V

    return-void
.end method

.method static synthetic access$11(Lcom/openfeint/internal/ui/WebViewCache;Ljava/util/Set;I)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 848
    invoke-direct {p0, p1, p2}, Lcom/openfeint/internal/ui/WebViewCache;->batchRequest(Ljava/util/Set;I)V

    return-void
.end method

.method static synthetic access$12(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;Ljava/lang/String;ILjava/util/Set;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 831
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/openfeint/internal/ui/WebViewCache;->batchFetch(Ljava/lang/String;Ljava/lang/String;ILjava/util/Set;)V

    return-void
.end method

.method static synthetic access$2()Ljava/lang/String;
    .locals 1

    .prologue
    .line 168
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$3(Lcom/openfeint/internal/ui/WebViewCache;)V
    .locals 0
    .parameter

    .prologue
    .line 452
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->sync()V

    return-void
.end method

.method static synthetic access$4(Lcom/openfeint/internal/ui/WebViewCache;)V
    .locals 0
    .parameter

    .prologue
    .line 536
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->deleteAll()V

    return-void
.end method

.method static synthetic access$5(Lcom/openfeint/internal/ui/WebViewCache;)V
    .locals 0
    .parameter

    .prologue
    .line 670
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->clientManifestReady()V

    return-void
.end method

.method static synthetic access$6(Lcom/openfeint/internal/ui/WebViewCache;Ljava/io/File;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 606
    invoke-direct {p0, p1}, Lcom/openfeint/internal/ui/WebViewCache;->copyDefaultBackground(Ljava/io/File;)V

    return-void
.end method

.method static synthetic access$7(Lcom/openfeint/internal/ui/WebViewCache;)V
    .locals 0
    .parameter

    .prologue
    .line 795
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->triggerUpdates()V

    return-void
.end method

.method static synthetic access$8(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;Z)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 996
    invoke-direct {p0, p1, p2}, Lcom/openfeint/internal/ui/WebViewCache;->finishItem(Ljava/lang/String;Z)V

    return-void
.end method

.method static synthetic access$9(Lcom/openfeint/internal/ui/WebViewCache;Ljava/util/Set;Z)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 1002
    invoke-direct {p0, p1, p2}, Lcom/openfeint/internal/ui/WebViewCache;->finishItems(Ljava/util/Set;Z)V

    return-void
.end method

.method private batchFetch(Ljava/lang/String;Ljava/lang/String;ILjava/util/Set;)V
    .locals 6
    .parameter "originalUrl"
    .parameter "currentUrl"
    .parameter "retriesLeft"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "I",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 832
    .local p4, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache$4;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move v4, p3

    move-object v5, p4

    invoke-direct/range {v0 .. v5}, Lcom/openfeint/internal/ui/WebViewCache$4;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;Ljava/lang/String;ILjava/util/Set;)V

    .line 841
    invoke-virtual {v0}, Lcom/openfeint/internal/ui/WebViewCache$4;->launch()V

    .line 842
    return-void
.end method

.method private batchRequest(Ljava/util/Set;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 845
    .local p1, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const/4 v0, 0x3

    invoke-direct {p0, p1, v0}, Lcom/openfeint/internal/ui/WebViewCache;->batchRequest(Ljava/util/Set;I)V

    .line 846
    return-void
.end method

.method private batchRequest(Ljava/util/Set;I)V
    .locals 8
    .parameter
    .parameter "numRetries"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;I)V"
        }
    .end annotation

    .prologue
    .line 849
    .local p1, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const-string v3, "WebViewCache"

    const-string v4, "Syncing %d items"

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/Object;

    const/4 v6, 0x0

    invoke-interface {p1}, Ljava/util/Set;->size()I

    move-result v7

    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    aput-object v7, v5, v6

    invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 851
    new-instance v1, Lcom/openfeint/internal/request/OrderedArgList;

    invoke-direct {v1}, Lcom/openfeint/internal/request/OrderedArgList;-><init>()V

    .line 853
    .local v1, oal:Lcom/openfeint/internal/request/OrderedArgList;
    invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_0

    .line 859
    new-instance v3, Lcom/openfeint/internal/ui/WebViewCache$5;

    invoke-direct {v3, p0, v1, p2, p1}, Lcom/openfeint/internal/ui/WebViewCache$5;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Lcom/openfeint/internal/request/OrderedArgList;ILjava/util/Set;)V

    .line 867
    invoke-virtual {v3}, Lcom/openfeint/internal/ui/WebViewCache$5;->launch()V

    .line 868
    return-void

    .line 853
    :cond_0
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 854
    .local v2, s:Ljava/lang/String;
    iget-object v4, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v4, v4, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v4, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 855
    .local v0, manifestItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    const-string v4, "files[][path]"

    iget-object v5, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-virtual {v1, v4, v5}, Lcom/openfeint/internal/request/OrderedArgList;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 856
    const-string v4, "files[][hash]"

    iget-object v5, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->hash:Ljava/lang/String;

    invoke-virtual {v1, v4, v5}, Lcom/openfeint/internal/request/OrderedArgList;->put(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method private clientManifestReady()V
    .locals 4

    .prologue
    .line 671
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->getDefaultClientManifest()Ljava/util/Map;

    move-result-object v1

    .line 672
    .local v1, obj:Ljava/util/Map;
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    const/4 v3, 0x3

    invoke-static {v2, v3}, Landroid/os/Message;->obtain(Landroid/os/Handler;I)Landroid/os/Message;

    move-result-object v0

    .line 673
    .local v0, msg:Landroid/os/Message;
    iput-object v1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 674
    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    .line 675
    return-void
.end method

.method private copyDefaultBackground(Ljava/io/File;)V
    .locals 4
    .parameter "baseDir"

    .prologue
    .line 607
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    .line 608
    .local v0, defaultItems:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const-string v2, "webui"

    invoke-direct {p0, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->gatherDefaultItems(Ljava/lang/String;Ljava/util/Set;)V

    .line 609
    invoke-direct {p0, v0}, Lcom/openfeint/internal/ui/WebViewCache;->stripUnused(Ljava/util/Set;)Ljava/util/Set;

    move-result-object v0

    .line 610
    const-string v2, "webui/manifest.plist"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 611
    const-string v2, "webui/javascripts/"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copyDirectory(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 612
    const-string v2, "webui/stylesheets/"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copyDirectory(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 613
    const-string v2, "webui/intro/"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copyDirectory(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 614
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-static {v2}, Lcom/openfeint/internal/Util;->getDpiName(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    const-string v3, "mdpi"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 615
    const-string v2, "webui/images/space.grid.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 616
    const-string v2, "webui/images/button.gray.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 617
    const-string v2, "webui/images/button.gray.hit.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 618
    const-string v2, "webui/images/button.green.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 619
    const-string v2, "webui/images/button.green.hit.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 620
    const-string v2, "webui/images/logo.small.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 621
    const-string v2, "webui/images/header_bg.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 622
    const-string v2, "webui/images/loading.spinner.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 623
    const-string v2, "webui/images/input.text.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 624
    const-string v2, "webui/images/frame.small.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 625
    const-string v2, "webui/images/icon.leaf.gray.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 626
    const-string v2, "webui/images/tab.divider.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 627
    const-string v2, "webui/images/tab.active_indicator.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 629
    const-string v2, "webui/images/logo.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 630
    const-string v2, "webui/images/header_bg.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 631
    const-string v2, "webui/images/loading.spinner.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 632
    const-string v2, "webui/images/icon.user.male.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 633
    const-string v2, "webui/images/intro.leaderboards.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 634
    const-string v2, "webui/images/intro.friends.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 635
    const-string v2, "webui/images/intro.achievements.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 636
    const-string v2, "webui/images/intro.games.mdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 663
    :goto_0
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->clientManifestReady()V

    .line 665
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_1

    .line 668
    return-void

    .line 640
    :cond_0
    const-string v2, "webui/images/space.grid.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 641
    const-string v2, "webui/images/button.gray.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 642
    const-string v2, "webui/images/button.gray.hit.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 643
    const-string v2, "webui/images/button.green.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 644
    const-string v2, "webui/images/button.green.hit.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 645
    const-string v2, "webui/images/logo.small.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 646
    const-string v2, "webui/images/header_bg.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 647
    const-string v2, "webui/images/loading.spinner.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 648
    const-string v2, "webui/images/input.text.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 649
    const-string v2, "webui/images/frame.small.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 650
    const-string v2, "webui/images/icon.leaf.gray.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 651
    const-string v2, "webui/images/tab.divider.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 652
    const-string v2, "webui/images/tab.active_indicator.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 654
    const-string v2, "webui/images/logo.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 655
    const-string v2, "webui/images/header_bg.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 656
    const-string v2, "webui/images/loading.spinner.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 657
    const-string v2, "webui/images/icon.user.male.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 658
    const-string v2, "webui/images/intro.leaderboards.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 659
    const-string v2, "webui/images/intro.friends.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 660
    const-string v2, "webui/images/intro.achievements.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    .line 661
    const-string v2, "webui/images/intro.games.hdpi.png"

    invoke-direct {p0, p1, v2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    goto :goto_0

    .line 665
    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 666
    .local v1, path:Ljava/lang/String;
    invoke-direct {p0, p1, v1}, Lcom/openfeint/internal/ui/WebViewCache;->copySingleItem(Ljava/io/File;Ljava/lang/String;)V

    goto :goto_1
.end method

.method private copyDirectory(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V
    .locals 4
    .parameter "baseDir"
    .parameter "root"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/File;",
            "Ljava/lang/String;",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 598
    .local p3, items:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    .line 599
    .local v0, dirItems:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {p3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_1

    .line 602
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_2

    .line 603
    return-void

    .line 599
    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 600
    .local v1, path:Ljava/lang/String;
    invoke-virtual {v1, p2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 602
    .end local v1           #path:Ljava/lang/String;
    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .restart local v1       #path:Ljava/lang/String;
    invoke-direct {p0, p1, v1, p3}, Lcom/openfeint/internal/ui/WebViewCache;->copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V

    goto :goto_1
.end method

.method private copySingleItem(Ljava/io/File;Ljava/lang/String;)V
    .locals 8
    .parameter "baseDir"
    .parameter "path"

    .prologue
    .line 566
    :try_start_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p1, p2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 567
    .local v1, filePath:Ljava/io/File;
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v6}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v6

    invoke-virtual {v6, p2}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v3

    .line 568
    .local v3, inputStream:Ljava/io/InputStream;
    new-instance v4, Ljava/io/DataInputStream;

    invoke-direct {v4, v3}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V

    .line 570
    .local v4, reader:Ljava/io/DataInputStream;
    invoke-virtual {v1}, Ljava/io/File;->getParentFile()Ljava/io/File;

    move-result-object v6

    invoke-virtual {v6}, Ljava/io/File;->mkdirs()Z

    .line 571
    new-instance v2, Ljava/io/FileOutputStream;

    invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 572
    .local v2, fileStream:Ljava/io/FileOutputStream;
    new-instance v5, Ljava/io/DataOutputStream;

    invoke-direct {v5, v2}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 573
    .local v5, writer:Ljava/io/DataOutputStream;
    invoke-static {v4, v5}, Lcom/openfeint/internal/Util;->copyStream(Ljava/io/InputStream;Ljava/io/OutputStream;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 578
    .end local v1           #filePath:Ljava/io/File;
    .end local v2           #fileStream:Ljava/io/FileOutputStream;
    .end local v3           #inputStream:Ljava/io/InputStream;
    .end local v4           #reader:Ljava/io/DataInputStream;
    .end local v5           #writer:Ljava/io/DataOutputStream;
    :goto_0
    return-void

    .line 575
    :catch_0
    move-exception v6

    move-object v0, v6

    .line 576
    .local v0, e:Ljava/lang/Exception;
    const-string v6, "WebViewCache"

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method private copySpecific(Ljava/io/File;Ljava/lang/String;Ljava/util/Set;)V
    .locals 1
    .parameter "baseDir"
    .parameter "path"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/File;",
            "Ljava/lang/String;",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 591
    .local p3, items:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {p3, p2}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 592
    invoke-direct {p0, p1, p2}, Lcom/openfeint/internal/ui/WebViewCache;->copySingleItem(Ljava/io/File;Ljava/lang/String;)V

    .line 593
    invoke-interface {p3, p2}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    .line 595
    :cond_0
    return-void
.end method

.method private deleteAll()V
    .locals 4

    .prologue
    .line 537
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getFilesDir()Ljava/io/File;

    move-result-object v0

    .line 538
    .local v0, baseDir:Ljava/io/File;
    new-instance v1, Ljava/io/File;

    const-string v2, "webui"

    invoke-direct {v1, v0, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 539
    .local v1, webui:Ljava/io/File;
    invoke-static {v1}, Lcom/openfeint/internal/Util;->deleteFiles(Ljava/io/File;)V

    .line 540
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    const-string v3, "manifest.db"

    invoke-virtual {v2, v3}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;

    move-result-object v2

    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    .line 541
    return-void
.end method

.method public static diskError()V
    .locals 3

    .prologue
    .line 212
    const/4 v1, 0x1

    sput-boolean v1, Lcom/openfeint/internal/ui/WebViewCache;->diskError:Z

    .line 213
    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    iget-object v1, v1, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_0

    .line 216
    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    iget-object v1, v1, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->clear()V

    .line 217
    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v1}, Lcom/openfeint/internal/ui/WebViewCache;->finishWithoutLoading()V

    .line 218
    return-void

    .line 213
    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;

    .line 214
    .local v0, pathAndCb:Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;
    iget-object v2, v0, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->callback:Lcom/openfeint/internal/ui/WebViewCacheCallback;

    invoke-virtual {v2}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->failLoaded()V

    goto :goto_0
.end method

.method private finishGlobals()V
    .locals 10

    .prologue
    .line 904
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :goto_0
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v6

    if-nez v6, :cond_1

    .line 916
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v5}, Ljava/util/Set;->clear()V

    .line 919
    new-instance v4, Ljava/util/HashSet;

    invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

    .line 920
    .local v4, priorityDependents:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_0
    :goto_1
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v6

    if-nez v6, :cond_3

    .line 927
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v4, v5}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 928
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v5, v4}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    .line 930
    const/4 v5, 0x1

    iput-boolean v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->globalsFinished:Z

    .line 931
    return-void

    .line 904
    .end local v4           #priorityDependents:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    :cond_1
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;

    .line 905
    .local v3, pathAndCb:Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    iget-object v7, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->path:Ljava/lang/String;

    invoke-interface {v6, v7}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v6

    if-nez v6, :cond_2

    .line 906
    iget-object v6, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->callback:Lcom/openfeint/internal/ui/WebViewCacheCallback;

    iget-object v7, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->path:Ljava/lang/String;

    invoke-virtual {v6, v7}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->pathLoaded(Ljava/lang/String;)V

    goto :goto_0

    .line 910
    :cond_2
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v6, v6, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    iget-object v7, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->path:Ljava/lang/String;

    invoke-interface {v6, v7}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 911
    .local v0, item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    new-instance v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    invoke-direct {v1, v0}, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;-><init>(Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;)V

    .line 912
    .local v1, newItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    iget-object v6, v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    iget-object v7, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v6, v7}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 913
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    iget-object v7, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->path:Ljava/lang/String;

    new-instance v8, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;

    iget-object v9, v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->callback:Lcom/openfeint/internal/ui/WebViewCacheCallback;

    invoke-direct {v8, v1, v9}, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;-><init>(Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;Lcom/openfeint/internal/ui/WebViewCacheCallback;)V

    invoke-interface {v6, v7, v8}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 920
    .end local v0           #item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    .end local v1           #newItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    .end local v3           #pathAndCb:Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;
    .restart local v4       #priorityDependents:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    :cond_3
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 921
    .local v2, path:Ljava/lang/String;
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v6, v2}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 922
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v6, v6, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v6, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 923
    .restart local v0       #item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    if-eqz v0, :cond_0

    .line 924
    iget-object v6, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    invoke-interface {v4, v6}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    goto :goto_1
.end method

.method private finishItem(Ljava/lang/String;Z)V
    .locals 2
    .parameter "path"
    .parameter "succeeded"

    .prologue
    const/4 v1, 0x1

    .line 997
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0, v1}, Ljava/util/HashSet;-><init>(I)V

    .line 998
    .local v0, tiny:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    invoke-virtual {v0, p1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 999
    invoke-direct {p0, v0, p2, v1}, Lcom/openfeint/internal/ui/WebViewCache;->finishItems(Ljava/util/Set;ZZ)V

    .line 1000
    return-void
.end method

.method private finishItems(Ljava/util/Set;Z)V
    .locals 1
    .parameter
    .parameter "succeeded"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;Z)V"
        }
    .end annotation

    .prologue
    .line 1003
    .local p1, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/openfeint/internal/ui/WebViewCache;->finishItems(Ljava/util/Set;ZZ)V

    .line 1004
    return-void
.end method

.method private finishItems(Ljava/util/Set;ZZ)V
    .locals 11
    .parameter
    .parameter "succeeded"
    .parameter "wasSingular"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;ZZ)V"
        }
    .end annotation

    .prologue
    .line 1007
    .local p1, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    if-nez v8, :cond_0

    .line 1054
    :goto_0
    return-void

    .line 1009
    :cond_0
    if-nez p2, :cond_1

    if-nez p3, :cond_1

    .line 1012
    const/4 v8, 0x1

    iput-boolean v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->batchesAreBroken:Z

    .line 1053
    :goto_1
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->loadNextItem()V

    goto :goto_0

    .line 1015
    :cond_1
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    invoke-interface {v8}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v8

    invoke-interface {v8}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v8

    :goto_2
    invoke-interface {v8}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-nez v9, :cond_4

    .line 1018
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v8, p1}, Ljava/util/Set;->removeAll(Ljava/util/Collection;)Z

    .line 1019
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v8, v8, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v8, p1}, Ljava/util/Set;->removeAll(Ljava/util/Collection;)Z

    .line 1020
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v8, p1}, Ljava/util/Set;->removeAll(Ljava/util/Collection;)Z

    .line 1023
    iget-boolean v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->globalsFinished:Z

    if-eqz v8, :cond_3

    .line 1024
    new-instance v6, Ljava/util/HashSet;

    invoke-direct {v6}, Ljava/util/HashSet;-><init>()V

    .line 1025
    .local v6, pathsToRemove:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    invoke-interface {v8}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v8

    invoke-interface {v8}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v8

    :cond_2
    :goto_3
    invoke-interface {v8}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-nez v9, :cond_5

    .line 1032
    invoke-virtual {v6}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v8

    :goto_4
    invoke-interface {v8}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-nez v9, :cond_6

    .line 1038
    .end local v6           #pathsToRemove:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    :cond_3
    invoke-interface {p1}, Ljava/util/Set;->size()I

    move-result v8

    new-array v5, v8, [Ljava/lang/String;

    .line 1039
    .local v5, pathsArray:[Ljava/lang/String;
    array-length v8, v5

    new-array v0, v8, [Ljava/lang/String;

    .line 1040
    .local v0, hashArray:[Ljava/lang/String;
    const/4 v2, 0x0

    .line 1041
    .local v2, i:I
    invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v9

    :goto_5
    invoke-interface {v9}, Ljava/util/Iterator;->hasNext()Z

    move-result v8

    if-nez v8, :cond_7

    .line 1050
    invoke-static {v5, v0}, Lcom/openfeint/internal/db/DB;->setClientManifestBatch([Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_1

    .line 1015
    .end local v0           #hashArray:[Ljava/lang/String;
    .end local v2           #i:I
    .end local v5           #pathsArray:[Ljava/lang/String;
    :cond_4
    invoke-interface {v8}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;

    .line 1016
    .local v3, itemAndCb:Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;
    iget-object v9, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v9, v9, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    invoke-interface {v9, p1}, Ljava/util/Set;->removeAll(Ljava/util/Collection;)Z

    goto :goto_2

    .line 1025
    .end local v3           #itemAndCb:Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;
    .restart local v6       #pathsToRemove:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    :cond_5
    invoke-interface {v8}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;

    .line 1026
    .restart local v3       #itemAndCb:Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;
    iget-object v9, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    iget-object v10, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v10, v10, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-interface {v9, v10}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v9

    if-nez v9, :cond_2

    iget-object v9, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v9, v9, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    invoke-interface {v9}, Ljava/util/Set;->size()I

    move-result v9

    if-nez v9, :cond_2

    .line 1027
    iget-object v9, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v9, v9, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-virtual {v6, v9}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 1028
    iget-object v9, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->callback:Lcom/openfeint/internal/ui/WebViewCacheCallback;

    iget-object v10, v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;->item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v10, v10, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-virtual {v9, v10}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->pathLoaded(Ljava/lang/String;)V

    goto :goto_3

    .line 1032
    .end local v3           #itemAndCb:Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;
    :cond_6
    invoke-interface {v8}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    .line 1033
    .local v7, removePath:Ljava/lang/String;
    iget-object v9, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    invoke-interface {v9, v7}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_4

    .line 1041
    .end local v6           #pathsToRemove:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    .end local v7           #removePath:Ljava/lang/String;
    .restart local v0       #hashArray:[Ljava/lang/String;
    .restart local v2       #i:I
    .restart local v5       #pathsArray:[Ljava/lang/String;
    :cond_7
    invoke-interface {v9}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    .line 1042
    .local v4, path:Ljava/lang/String;
    if-eqz p2, :cond_8

    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v8, v8, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v8, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    iget-object v8, v8, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->hash:Ljava/lang/String;

    move-object v1, v8

    .line 1044
    .local v1, hashValue:Ljava/lang/String;
    :goto_6
    aput-object v4, v5, v2

    .line 1045
    aput-object v1, v0, v2

    .line 1046
    add-int/lit8 v2, v2, 0x1

    .line 1048
    iget-object v8, p0, Lcom/openfeint/internal/ui/WebViewCache;->clientManifest:Ljava/util/Map;

    invoke-interface {v8, v4, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_5

    .line 1042
    .end local v1           #hashValue:Ljava/lang/String;
    :cond_8
    const-string v8, "INVALID"

    move-object v1, v8

    goto :goto_6
.end method

.method private finishLoading()V
    .locals 1

    .prologue
    .line 827
    sget-object v0, Lcom/openfeint/internal/db/DB;->storeHelper:Lcom/openfeint/internal/db/DB$DataStorageHelperX;

    invoke-virtual {v0}, Lcom/openfeint/internal/db/DB$DataStorageHelperX;->close()V

    .line 828
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    .line 829
    return-void
.end method

.method private finishWithoutLoading()V
    .locals 4

    .prologue
    .line 813
    const-string v1, "WebViewCache"

    const-string v2, "finishWithoutLoading"

    invoke-static {v1, v2}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 816
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_0

    .line 819
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->clear()V

    .line 820
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->clear()V

    .line 821
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v1, v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->clear()V

    .line 822
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v1}, Ljava/util/Set;->clear()V

    .line 823
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->finishLoading()V

    .line 824
    return-void

    .line 816
    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;

    .line 817
    .local v0, pathAndCb:Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;
    iget-object v2, v0, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->callback:Lcom/openfeint/internal/ui/WebViewCacheCallback;

    iget-object v3, v0, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;->path:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->pathLoaded(Ljava/lang/String;)V

    goto :goto_0
.end method

.method private static fullOuterJoin(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 9
    .parameter "fields"
    .parameter "table1"
    .parameter "table2"
    .parameter "condition"

    .prologue
    const/4 v8, 0x4

    const/4 v7, 0x3

    const/4 v6, 0x2

    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 1148
    const-string v2, "SELECT %s from %s LEFT OUTER JOIN %s ON %s"

    new-array v3, v8, [Ljava/lang/Object;

    aput-object p0, v3, v4

    aput-object p1, v3, v5

    aput-object p2, v3, v6

    aput-object p3, v3, v7

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .line 1149
    .local v0, join1:Ljava/lang/String;
    const-string v2, "SELECT %s from %s LEFT OUTER JOIN %s ON %s"

    new-array v3, v8, [Ljava/lang/Object;

    aput-object p0, v3, v4

    aput-object p2, v3, v5

    aput-object p1, v3, v6

    aput-object p3, v3, v7

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    .line 1150
    .local v1, join2:Ljava/lang/String;
    const-string v2, "%s UNION %s;"

    new-array v3, v6, [Ljava/lang/Object;

    aput-object v0, v3, v4

    aput-object v1, v3, v5

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    return-object v2
.end method

.method private gatherDefaultItems(Ljava/lang/String;Ljava/util/Set;)V
    .locals 9
    .parameter "path"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 545
    .local p2, items:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    :try_start_0
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v5

    invoke-virtual {v5, p1}, Landroid/content/res/AssetManager;->list(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    .line 546
    .local v4, stuff:[Ljava/lang/String;
    array-length v5, v4

    const/4 v6, 0x0

    :goto_0
    if-lt v6, v5, :cond_0

    .line 562
    .end local v4           #stuff:[Ljava/lang/String;
    :goto_1
    return-void

    .line 546
    .restart local v4       #stuff:[Ljava/lang/String;
    :cond_0
    aget-object v3, v4, v6

    .line 547
    .local v3, s:Ljava/lang/String;
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v8, "/"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v2

    .line 549
    .local v2, fullpath:Ljava/lang/String;
    :try_start_1
    iget-object v7, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v7}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v7

    invoke-virtual {v7, v2}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v0

    .line 550
    .local v0, check:Ljava/io/InputStream;
    invoke-interface {p2, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 551
    invoke-virtual {v0}, Ljava/io/InputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    .line 546
    .end local v0           #check:Ljava/io/InputStream;
    :goto_2
    add-int/lit8 v6, v6, 0x1

    goto :goto_0

    .line 553
    :catch_0
    move-exception v7

    move-object v1, v7

    .line 555
    .local v1, e:Ljava/io/IOException;
    :try_start_2
    invoke-direct {p0, v2, p2}, Lcom/openfeint/internal/ui/WebViewCache;->gatherDefaultItems(Ljava/lang/String;Ljava/util/Set;)V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_2

    .line 558
    .end local v1           #e:Ljava/io/IOException;
    .end local v2           #fullpath:Ljava/lang/String;
    .end local v3           #s:Ljava/lang/String;
    .end local v4           #stuff:[Ljava/lang/String;
    :catch_1
    move-exception v5

    move-object v1, v5

    .line 559
    .restart local v1       #e:Ljava/io/IOException;
    const-string v5, "WebViewCache"

    invoke-virtual {v1}, Ljava/io/IOException;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1
.end method

.method private getDefaultClientManifest()Ljava/util/Map;
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 729
    const/4 v5, 0x0

    .line 730
    .local v5, result:Landroid/database/Cursor;
    const/4 v0, 0x0

    .line 732
    .local v0, db:Landroid/database/sqlite/SQLiteDatabase;
    :try_start_0
    sget-object v6, Lcom/openfeint/internal/db/DB;->storeHelper:Lcom/openfeint/internal/db/DB$DataStorageHelperX;

    invoke-virtual {v6}, Lcom/openfeint/internal/db/DB$DataStorageHelperX;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 733
    const-string v6, "SELECT * FROM manifest"

    const/4 v7, 0x0

    invoke-virtual {v0, v6, v7}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v5

    .line 734
    invoke-interface {v5}, Landroid/database/Cursor;->getCount()I

    move-result v6

    if-lez v6, :cond_1

    .line 736
    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    .line 737
    .local v3, outManifest:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v5}, Landroid/database/Cursor;->moveToFirst()Z

    .line 739
    :cond_0
    const/4 v6, 0x0

    invoke-interface {v5, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 740
    .local v4, path:Ljava/lang/String;
    const/4 v6, 0x1

    invoke-interface {v5, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    .line 741
    .local v2, hash:Ljava/lang/String;
    invoke-interface {v3, v4, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 742
    invoke-interface {v5}, Landroid/database/Cursor;->moveToNext()Z

    move-result v6

    .line 738
    if-nez v6, :cond_0

    .line 743
    invoke-interface {v5}, Landroid/database/Cursor;->close()V

    .line 744
    const-string v6, "WebViewCache"

    const-string v7, "create client Manifest from db"

    invoke-static {v6, v7}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Landroid/database/sqlite/SQLiteDiskIOException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 753
    :try_start_1
    invoke-interface {v5}, Landroid/database/Cursor;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4

    :goto_0
    move-object v6, v3

    .line 756
    .end local v2           #hash:Ljava/lang/String;
    .end local v3           #outManifest:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v4           #path:Ljava/lang/String;
    :goto_1
    return-object v6

    .line 747
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 748
    .local v1, e:Landroid/database/sqlite/SQLiteDiskIOException;
    :try_start_2
    invoke-static {}, Lcom/openfeint/internal/ui/WebViewCache;->diskError()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 753
    :try_start_3
    invoke-interface {v5}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_5

    .line 756
    .end local v1           #e:Landroid/database/sqlite/SQLiteDiskIOException;
    :goto_2
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->getDefaultClientManifestFromAsset()Ljava/util/Map;

    move-result-object v6

    goto :goto_1

    .line 749
    :catch_1
    move-exception v6

    move-object v1, v6

    .line 751
    .local v1, e:Ljava/lang/Exception;
    :try_start_4
    const-string v6, "WebViewCache"

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "SQLite exception. "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 753
    :try_start_5
    invoke-interface {v5}, Landroid/database/Cursor;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2

    goto :goto_2

    :catch_2
    move-exception v6

    goto :goto_2

    .line 752
    .end local v1           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v6

    .line 753
    :try_start_6
    invoke-interface {v5}, Landroid/database/Cursor;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_6

    .line 754
    :goto_3
    throw v6

    .line 753
    :cond_1
    :try_start_7
    invoke-interface {v5}, Landroid/database/Cursor;->close()V
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_3

    goto :goto_2

    :catch_3
    move-exception v6

    goto :goto_2

    .restart local v2       #hash:Ljava/lang/String;
    .restart local v3       #outManifest:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    .restart local v4       #path:Ljava/lang/String;
    :catch_4
    move-exception v6

    goto :goto_0

    .end local v2           #hash:Ljava/lang/String;
    .end local v3           #outManifest:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v4           #path:Ljava/lang/String;
    .local v1, e:Landroid/database/sqlite/SQLiteDiskIOException;
    :catch_5
    move-exception v6

    goto :goto_2

    .end local v1           #e:Landroid/database/sqlite/SQLiteDiskIOException;
    :catch_6
    move-exception v7

    goto :goto_3
.end method

.method private getDefaultClientManifestFromAsset()Ljava/util/Map;
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 762
    new-instance v3, Ljava/io/File;

    sget-object v7, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    const-string v8, "manifest.plist"

    invoke-direct {v3, v7, v8}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 763
    .local v3, manifestFile:Ljava/io/File;
    invoke-virtual {v3}, Ljava/io/File;->isFile()Z

    move-result v7

    if-eqz v7, :cond_0

    .line 765
    :try_start_0
    invoke-static {}, Ljavax/xml/parsers/SAXParserFactory;->newInstance()Ljavax/xml/parsers/SAXParserFactory;

    move-result-object v5

    .line 766
    .local v5, spf:Ljavax/xml/parsers/SAXParserFactory;
    invoke-virtual {v5}, Ljavax/xml/parsers/SAXParserFactory;->newSAXParser()Ljavax/xml/parsers/SAXParser;

    move-result-object v4

    .line 767
    .local v4, sp:Ljavax/xml/parsers/SAXParser;
    invoke-virtual {v4}, Ljavax/xml/parsers/SAXParser;->getXMLReader()Lorg/xml/sax/XMLReader;

    move-result-object v6

    .line 768
    .local v6, xr:Lorg/xml/sax/XMLReader;
    new-instance v1, Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;

    const/4 v7, 0x0

    invoke-direct {v1, p0, v7}, Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;)V

    .line 769
    .local v1, handler:Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;
    invoke-interface {v6, v1}, Lorg/xml/sax/XMLReader;->setContentHandler(Lorg/xml/sax/ContentHandler;)V

    .line 770
    new-instance v2, Ljava/io/FileInputStream;

    invoke-virtual {v3}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v2, v7}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V

    .line 771
    .local v2, inputStream:Ljava/io/InputStream;
    new-instance v7, Lorg/xml/sax/InputSource;

    invoke-direct {v7, v2}, Lorg/xml/sax/InputSource;-><init>(Ljava/io/InputStream;)V

    invoke-interface {v6, v7}, Lorg/xml/sax/XMLReader;->parse(Lorg/xml/sax/InputSource;)V

    .line 772
    invoke-virtual {v1}, Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;->getOutputMap()Ljava/util/Map;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v7

    .line 778
    .end local v1           #handler:Lcom/openfeint/internal/ui/WebViewCache$SaxHandler;
    .end local v2           #inputStream:Ljava/io/InputStream;
    .end local v4           #sp:Ljavax/xml/parsers/SAXParser;
    .end local v5           #spf:Ljavax/xml/parsers/SAXParserFactory;
    .end local v6           #xr:Lorg/xml/sax/XMLReader;
    :goto_0
    return-object v7

    .line 774
    :catch_0
    move-exception v7

    move-object v0, v7

    .line 775
    .local v0, e:Ljava/lang/Exception;
    const-string v7, "WebViewCache"

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 778
    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    new-instance v7, Ljava/util/HashMap;

    invoke-direct {v7}, Ljava/util/HashMap;-><init>()V

    goto :goto_0
.end method

.method public static final getItemUri(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "itemPath"

    .prologue
    .line 156
    new-instance v0, Ljava/lang/StringBuilder;

    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->rootUri:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private static final getManifestPath(Landroid/content/Context;)Ljava/lang/String;
    .locals 6
    .parameter "ctx"

    .prologue
    .line 790
    const-string v0, "android"

    .line 791
    .local v0, platform:Ljava/lang/String;
    sget-object v2, Lcom/openfeint/internal/ui/WebViewCache;->manifestProductOverride:Ljava/lang/String;

    if-eqz v2, :cond_0

    sget-object v2, Lcom/openfeint/internal/ui/WebViewCache;->manifestProductOverride:Ljava/lang/String;

    move-object v1, v2

    .line 792
    .local v1, product:Ljava/lang/String;
    :goto_0
    const-string v2, "/webui/manifest/%s.%s.%s"

    const/4 v3, 0x3

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    const-string v5, "android"

    aput-object v5, v3, v4

    const/4 v4, 0x1

    aput-object v1, v3, v4

    const/4 v4, 0x2

    invoke-static {p0}, Lcom/openfeint/internal/Util;->getDpiName(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    return-object v2

    .line 791
    .end local v1           #product:Ljava/lang/String;
    :cond_0
    const-string v2, "embed"

    move-object v1, v2

    goto :goto_0
.end method

.method private static final getServerURI()Ljava/net/URI;
    .locals 3

    .prologue
    .line 782
    :try_start_0
    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->serverOverride:Ljava/net/URI;

    if-eqz v1, :cond_0

    sget-object v1, Lcom/openfeint/internal/ui/WebViewCache;->serverOverride:Ljava/net/URI;

    .line 785
    :goto_0
    return-object v1

    .line 783
    :cond_0
    new-instance v1, Ljava/net/URI;

    invoke-static {}, Lcom/openfeint/internal/OpenFeintInternal;->getInstance()Lcom/openfeint/internal/OpenFeintInternal;

    move-result-object v2

    invoke-virtual {v2}, Lcom/openfeint/internal/OpenFeintInternal;->getServerUrl()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 784
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 785
    .local v0, e:Ljava/lang/Exception;
    const/4 v1, 0x0

    goto :goto_0
.end method

.method private handleBatchBody(I[BLjava/lang/String;Ljava/lang/String;ILjava/util/Set;)V
    .locals 8
    .parameter "responseCode"
    .parameter "body"
    .parameter "originalUrl"
    .parameter "currentUrl"
    .parameter "retriesLeft"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I[B",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "I",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p6, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const/4 v2, 0x2

    const/4 v1, 0x0

    .line 871
    const/16 v0, 0xc8

    if-gt v0, p1, :cond_0

    const/16 v0, 0x12c

    if-ge p1, v0, :cond_0

    .line 872
    invoke-direct {p0, p6, p2}, Lcom/openfeint/internal/ui/WebViewCache;->processBatch(Ljava/util/Set;[B)V

    .line 899
    :goto_0
    return-void

    .line 873
    :cond_0
    const/16 v0, 0x12e

    if-eq v0, p1, :cond_1

    const/16 v0, 0x12f

    if-ne v0, p1, :cond_2

    .line 875
    :cond_1
    invoke-direct {p0, p3, p4, p5, p6}, Lcom/openfeint/internal/ui/WebViewCache;->batchFetch(Ljava/lang/String;Ljava/lang/String;ILjava/util/Set;)V

    goto :goto_0

    .line 876
    :cond_2
    if-eqz p1, :cond_3

    const/16 v0, 0x190

    if-gt v0, p1, :cond_5

    const/16 v0, 0x1f4

    if-ge p1, v0, :cond_5

    .line 877
    :cond_3
    if-lez p5, :cond_4

    .line 879
    iget-object v7, p0, Lcom/openfeint/internal/ui/WebViewCache;->mDelayHandler:Landroid/os/Handler;

    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache$6;

    move-object v1, p0

    move-object v2, p3

    move-object v3, p4

    move-object v4, p6

    move v5, p5

    invoke-direct/range {v0 .. v5}, Lcom/openfeint/internal/ui/WebViewCache$6;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;I)V

    .line 888
    const-wide/16 v1, 0x1388

    .line 879
    invoke-virtual {v7, v0, v1, v2}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    goto :goto_0

    .line 891
    :cond_4
    iget-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    invoke-static {v0, v2, v1, v1, p6}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v6

    .line 892
    .local v6, msg:Landroid/os/Message;
    invoke-virtual {v6}, Landroid/os/Message;->sendToTarget()V

    goto :goto_0

    .line 896
    .end local v6           #msg:Landroid/os/Message;
    :cond_5
    iget-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    invoke-static {v0, v2, v1, v1, p6}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v6

    .line 897
    .restart local v6       #msg:Landroid/os/Message;
    invoke-virtual {v6}, Landroid/os/Message;->sendToTarget()V

    goto :goto_0
.end method

.method public static initialize(Landroid/content/Context;)Lcom/openfeint/internal/ui/WebViewCache;
    .locals 1
    .parameter "context"

    .prologue
    .line 57
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    if-eqz v0, :cond_0

    .line 59
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0}, Lcom/openfeint/internal/ui/WebViewCache;->finishWithoutLoading()V

    .line 61
    :cond_0
    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0, p0}, Lcom/openfeint/internal/ui/WebViewCache;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    .line 62
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    return-object v0
.end method

.method public static isDiskError()Z
    .locals 1

    .prologue
    .line 702
    sget-boolean v0, Lcom/openfeint/internal/ui/WebViewCache;->diskError:Z

    return v0
.end method

.method public static isLoaded(Ljava/lang/String;)Z
    .locals 1
    .parameter "path"

    .prologue
    .line 74
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0, p0}, Lcom/openfeint/internal/ui/WebViewCache;->isLoadedInner(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method private isLoadedInner(Ljava/lang/String;)Z
    .locals 1
    .parameter "path"

    .prologue
    .line 389
    iget-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    .line 391
    :goto_0
    return v0

    .line 390
    :cond_0
    iget-object v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v0, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    const/4 v0, 0x0

    goto :goto_0

    .line 391
    :cond_1
    const/4 v0, 0x1

    goto :goto_0
.end method

.method private loadNextItem()V
    .locals 5

    .prologue
    const/4 v4, 0x1

    .line 934
    const-string v2, "WebViewCache"

    const-string v3, "loadNextItem"

    invoke-static {v2, v3}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 935
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    iget-object v3, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2, v3}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 937
    iget-boolean v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->globalsFinished:Z

    if-nez v2, :cond_0

    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 938
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->finishGlobals()V

    .line 941
    :cond_0
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    iget-object v3, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2, v3}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 943
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->size()I

    move-result v2

    iget-object v3, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v3}, Ljava/util/Set;->size()I

    move-result v3

    add-int v1, v2, v3

    .line 945
    .local v1, numGlobalsAndPrioritized:I
    iget-boolean v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->batchesAreBroken:Z

    if-nez v2, :cond_1

    if-le v1, v4, :cond_1

    .line 946
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    .line 947
    .local v0, combinedGlobalsAndPrio:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v0, v2}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    .line 948
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v0, v2}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    .line 949
    invoke-direct {p0, v0}, Lcom/openfeint/internal/ui/WebViewCache;->batchRequest(Ljava/util/Set;)V

    .line 966
    .end local v0           #combinedGlobalsAndPrio:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    :goto_0
    return-void

    .line 951
    :cond_1
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->size()I

    move-result v2

    if-lez v2, :cond_2

    .line 952
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->globals:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-direct {p0, v2}, Lcom/openfeint/internal/ui/WebViewCache;->singleRequest(Ljava/lang/String;)V

    goto :goto_0

    .line 954
    :cond_2
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->size()I

    move-result v2

    if-lez v2, :cond_3

    .line 955
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-direct {p0, v2}, Lcom/openfeint/internal/ui/WebViewCache;->singleRequest(Ljava/lang/String;)V

    goto :goto_0

    .line 957
    :cond_3
    iget-boolean v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->batchesAreBroken:Z

    if-nez v2, :cond_4

    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->size()I

    move-result v2

    if-le v2, v4, :cond_4

    .line 958
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-direct {p0, v2}, Lcom/openfeint/internal/ui/WebViewCache;->batchRequest(Ljava/util/Set;)V

    goto :goto_0

    .line 960
    :cond_4
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->size()I

    move-result v2

    if-lez v2, :cond_5

    .line 961
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-direct {p0, v2}, Lcom/openfeint/internal/ui/WebViewCache;->singleRequest(Ljava/lang/String;)V

    goto :goto_0

    .line 964
    :cond_5
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->finishLoading()V

    goto :goto_0
.end method

.method public static prioritize(Ljava/lang/String;)V
    .locals 1
    .parameter "path"

    .prologue
    .line 66
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0, p0}, Lcom/openfeint/internal/ui/WebViewCache;->prioritizeInner(Ljava/lang/String;)V

    .line 67
    return-void
.end method

.method private prioritizeInner(Ljava/lang/String;)V
    .locals 5
    .parameter "path"

    .prologue
    .line 1057
    iget-boolean v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    if-eqz v2, :cond_1

    .line 1072
    :cond_0
    :goto_0
    return-void

    .line 1058
    :cond_1
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v2, p1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 1059
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    if-eqz v2, :cond_0

    .line 1061
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v2, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 1062
    .local v0, item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    if-eqz v0, :cond_0

    .line 1063
    new-instance v1, Ljava/util/HashSet;

    iget-object v2, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    invoke-direct {v1, v2}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V

    .line 1066
    .local v1, loadingDependents:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v1, v2}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 1067
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->prioritizedPaths:Ljava/util/Set;

    invoke-interface {v2, v1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    .line 1068
    const-string v2, "WebViewCache"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Prioritizing "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " deps:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method private processBatch(Ljava/util/Set;[B)V
    .locals 10
    .parameter
    .parameter "body"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;[B)V"
        }
    .end annotation

    .prologue
    .local p1, paths:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const/4 v9, 0x2

    const/4 v8, 0x0

    .line 1078
    new-instance v1, Ljava/util/HashSet;

    invoke-direct {v1}, Ljava/util/HashSet;-><init>()V

    .line 1079
    .local v1, fetchedPaths:Ljava/util/HashSet;,"Ljava/util/HashSet<Ljava/lang/String;>;"
    new-instance v5, Ljava/util/zip/ZipInputStream;

    new-instance v6, Ljava/io/ByteArrayInputStream;

    invoke-direct {v6, p2}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    invoke-direct {v5, v6}, Ljava/util/zip/ZipInputStream;-><init>(Ljava/io/InputStream;)V

    .line 1081
    .local v5, zis:Ljava/util/zip/ZipInputStream;
    const/4 v4, 0x0

    .line 1082
    .local v4, ze:Ljava/util/zip/ZipEntry;
    :cond_0
    :goto_0
    :try_start_0
    invoke-virtual {v5}, Ljava/util/zip/ZipInputStream;->getNextEntry()Ljava/util/zip/ZipEntry;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v4

    if-nez v4, :cond_1

    .line 1094
    :goto_1
    invoke-virtual {v1}, Ljava/util/HashSet;->isEmpty()Z

    move-result v6

    if-nez v6, :cond_2

    .line 1095
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    const/4 v7, 0x1

    invoke-static {v6, v9, v7, v8, v1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v3

    .line 1096
    .local v3, msg:Landroid/os/Message;
    invoke-virtual {v3}, Landroid/os/Message;->sendToTarget()V

    .line 1101
    :goto_2
    return-void

    .line 1083
    .end local v3           #msg:Landroid/os/Message;
    :cond_1
    :try_start_1
    invoke-virtual {v4}, Ljava/util/zip/ZipEntry;->isDirectory()Z

    move-result v6

    if-nez v6, :cond_0

    .line 1084
    invoke-virtual {v4}, Ljava/util/zip/ZipEntry;->getName()Ljava/lang/String;

    move-result-object v2

    .line 1085
    .local v2, finalPath:Ljava/lang/String;
    new-instance v6, Ljava/lang/StringBuilder;

    sget-object v7, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/openfeint/internal/Util;->saveStreamAndLeaveInputOpen(Ljava/io/InputStream;Ljava/lang/String;)V

    .line 1086
    invoke-virtual {v1, v2}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 1089
    .end local v2           #finalPath:Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v0, v6

    .line 1091
    .local v0, e:Ljava/lang/Exception;
    const-string v6, "WebViewCache"

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 1098
    .end local v0           #e:Ljava/lang/Exception;
    :cond_2
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->mHandler:Landroid/os/Handler;

    invoke-static {v6, v9, v8, v8, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v3

    .line 1099
    .restart local v3       #msg:Landroid/os/Message;
    invoke-virtual {v3}, Landroid/os/Message;->sendToTarget()V

    goto :goto_2
.end method

.method public static recover()Z
    .locals 1

    .prologue
    .line 706
    sget-boolean v0, Lcom/openfeint/internal/ui/WebViewCache;->diskError:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 707
    :goto_0
    return v0

    :cond_0
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-virtual {v0}, Lcom/openfeint/internal/ui/WebViewCache;->recoverInternal()Z

    move-result v0

    goto :goto_0
.end method

.method private final singleRequest(Ljava/lang/String;)V
    .locals 3
    .parameter "finalPath"

    .prologue
    .line 969
    const-string v0, "WebViewCache"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Syncing item: "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 971
    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache$7;

    invoke-direct {v0, p0, p1}, Lcom/openfeint/internal/ui/WebViewCache$7;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;)V

    .line 993
    invoke-virtual {v0}, Lcom/openfeint/internal/ui/WebViewCache$7;->launch()V

    .line 994
    return-void
.end method

.method public static start()V
    .locals 1

    .prologue
    .line 160
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0}, Lcom/openfeint/internal/ui/WebViewCache;->updateExternalStorageState()V

    .line 161
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0}, Lcom/openfeint/internal/ui/WebViewCache;->sync()V

    .line 162
    return-void
.end method

.method private stripUnused(Ljava/util/Set;)Ljava/util/Set;
    .locals 6
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;)",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 581
    .local p1, table:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    iget-object v4, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-static {v4}, Lcom/openfeint/internal/Util;->getDpiName(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    .line 582
    .local v0, currentDpi:Ljava/lang/String;
    const-string v4, "mdpi"

    invoke-virtual {v0, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1

    const-string v4, ".hdpi."

    move-object v3, v4

    .line 583
    .local v3, test:Ljava/lang/String;
    :goto_0
    new-instance v2, Ljava/util/HashSet;

    invoke-direct {v2}, Ljava/util/HashSet;-><init>()V

    .line 584
    .local v2, reducedSet:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_0
    :goto_1
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-nez v5, :cond_2

    .line 587
    return-object v2

    .line 582
    .end local v2           #reducedSet:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    .end local v3           #test:Ljava/lang/String;
    :cond_1
    const-string v4, ".mdpi."

    move-object v3, v4

    goto :goto_0

    .line 584
    .restart local v2       #reducedSet:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    .restart local v3       #test:Ljava/lang/String;
    :cond_2
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 585
    .local v1, path:Ljava/lang/String;
    invoke-virtual {v1, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-nez v5, :cond_0

    invoke-interface {v2, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    goto :goto_1
.end method

.method private sync()V
    .locals 3

    .prologue
    .line 453
    const-string v1, "WebViewCache"

    const-string v2, "--- WebViewCache Sync ---"

    invoke-static {v1, v2}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 455
    new-instance v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestRequest;

    const-string v1, "manifest"

    invoke-direct {v0, p0, v1}, Lcom/openfeint/internal/ui/WebViewCache$ManifestRequest;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/lang/String;)V

    .line 456
    .local v0, req:Lcom/openfeint/internal/ui/WebViewCache$ManifestRequest;
    invoke-virtual {v0}, Lcom/openfeint/internal/ui/WebViewCache$ManifestRequest;->launch()V

    .line 457
    return-void
.end method

.method public static testOnlyManifestItems()[Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;
    .locals 12

    .prologue
    const/4 v11, 0x0

    .line 1154
    sget-object v7, Lcom/openfeint/internal/db/DB;->storeHelper:Lcom/openfeint/internal/db/DB$DataStorageHelperX;

    invoke-virtual {v7}, Lcom/openfeint/internal/db/DB$DataStorageHelperX;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 1156
    .local v1, db:Landroid/database/sqlite/SQLiteDatabase;
    const/4 v4, 0x0

    .line 1158
    .local v4, result:Landroid/database/Cursor;
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 1161
    .local v2, items:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;>;"
    :try_start_0
    const-string v7, "server_manifest.path, server_manifest.hash, manifest.hash"

    const-string v8, "server_manifest"

    const-string v9, "manifest"

    const-string v10, "server_manifest.path = manifest.path"

    invoke-static {v7, v8, v9, v10}, Lcom/openfeint/internal/ui/WebViewCache;->fullOuterJoin(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    const/4 v8, 0x0

    .line 1160
    invoke-virtual {v1, v7, v8}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v4

    .line 1163
    invoke-interface {v4}, Landroid/database/Cursor;->getCount()I

    move-result v7

    if-lez v7, :cond_2

    .line 1164
    invoke-interface {v4}, Landroid/database/Cursor;->moveToFirst()Z

    .line 1166
    :cond_0
    const/4 v7, 0x0

    invoke-interface {v4, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 1167
    .local v3, path:Ljava/lang/String;
    if-eqz v3, :cond_1

    .line 1168
    const/4 v7, 0x1

    invoke-interface {v4, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v6

    .line 1169
    .local v6, serverHash:Ljava/lang/String;
    const/4 v7, 0x2

    invoke-interface {v4, v7}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 1170
    .local v0, clientHash:Ljava/lang/String;
    new-instance v7, Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;

    invoke-direct {v7, v3, v0, v6}, Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v2, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 1172
    .end local v0           #clientHash:Ljava/lang/String;
    .end local v6           #serverHash:Ljava/lang/String;
    :cond_1
    invoke-interface {v4}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v7

    .line 1165
    if-nez v7, :cond_0

    .line 1176
    .end local v3           #path:Ljava/lang/String;
    :cond_2
    :try_start_1
    invoke-interface {v4}, Landroid/database/Cursor;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_3

    .line 1180
    :goto_0
    new-array v7, v11, [Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;

    invoke-virtual {v2, v7}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v5

    check-cast v5, [Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;

    .line 1181
    .local v5, rv:[Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;
    new-instance v7, Lcom/openfeint/internal/ui/WebViewCache$8;

    invoke-direct {v7}, Lcom/openfeint/internal/ui/WebViewCache$8;-><init>()V

    invoke-static {v5, v7}, Ljava/util/Arrays;->sort([Ljava/lang/Object;Ljava/util/Comparator;)V

    .line 1187
    return-object v5

    .line 1174
    .end local v5           #rv:[Lcom/openfeint/internal/ui/WebViewCache$TestOnlyManifestItem;
    :catch_0
    move-exception v7

    .line 1176
    :try_start_2
    invoke-interface {v4}, Landroid/database/Cursor;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_0

    :catch_1
    move-exception v7

    goto :goto_0

    .line 1175
    :catchall_0
    move-exception v7

    .line 1176
    :try_start_3
    invoke-interface {v4}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2

    .line 1177
    :goto_1
    throw v7

    .line 1176
    :catch_2
    move-exception v8

    goto :goto_1

    :catch_3
    move-exception v7

    goto :goto_0
.end method

.method public static trackPath(Ljava/lang/String;Lcom/openfeint/internal/ui/WebViewCacheCallback;)Z
    .locals 1
    .parameter "path"
    .parameter "cb"

    .prologue
    .line 70
    sget-object v0, Lcom/openfeint/internal/ui/WebViewCache;->sInstance:Lcom/openfeint/internal/ui/WebViewCache;

    invoke-direct {v0, p0, p1}, Lcom/openfeint/internal/ui/WebViewCache;->trackPathInner(Ljava/lang/String;Lcom/openfeint/internal/ui/WebViewCacheCallback;)Z

    move-result v0

    return v0
.end method

.method private trackPathInner(Ljava/lang/String;Lcom/openfeint/internal/ui/WebViewCacheCallback;)Z
    .locals 5
    .parameter "path"
    .parameter "cb"

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 360
    iget-boolean v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    if-eqz v2, :cond_0

    .line 361
    invoke-virtual {p2, p1}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->pathLoaded(Ljava/lang/String;)V

    move v2, v3

    .line 382
    :goto_0
    return v2

    .line 364
    :cond_0
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    if-nez v2, :cond_1

    .line 365
    invoke-virtual {p2}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->onTrackingNeeded()V

    .line 366
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedPaths:Ljava/util/Set;

    new-instance v3, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;

    invoke-direct {v3, p1, p2}, Lcom/openfeint/internal/ui/WebViewCache$PathAndCallback;-><init>(Ljava/lang/String;Lcom/openfeint/internal/ui/WebViewCacheCallback;)V

    invoke-interface {v2, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    move v2, v4

    .line 367
    goto :goto_0

    .line 370
    :cond_1
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v2, v2, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v2, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 371
    .local v0, loadedItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    if-eqz v0, :cond_2

    .line 373
    invoke-virtual {p2}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->onTrackingNeeded()V

    .line 374
    new-instance v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    invoke-direct {v1, v0}, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;-><init>(Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;)V

    .line 375
    .local v1, newItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    iget-object v2, v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->dependentObjects:Ljava/util/Set;

    iget-object v3, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    invoke-interface {v2, v3}, Ljava/util/Set;->retainAll(Ljava/util/Collection;)Z

    .line 376
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->trackedItems:Ljava/util/Map;

    new-instance v3, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;

    invoke-direct {v3, v1, p2}, Lcom/openfeint/internal/ui/WebViewCache$ItemAndCallback;-><init>(Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;Lcom/openfeint/internal/ui/WebViewCacheCallback;)V

    invoke-interface {v2, p1, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v2, v4

    .line 377
    goto :goto_0

    .line 381
    .end local v1           #newItem:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    :cond_2
    invoke-virtual {p2, p1}, Lcom/openfeint/internal/ui/WebViewCacheCallback;->pathLoaded(Ljava/lang/String;)V

    move v2, v3

    .line 382
    goto :goto_0
.end method

.method private triggerUpdates()V
    .locals 5

    .prologue
    .line 797
    const-string v1, "WebViewCache"

    const-string v2, "loadedManifest"

    invoke-static {v1, v2}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 800
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->clientManifest:Ljava/util/Map;

    if-eqz v1, :cond_1

    .line 802
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    iget-object v1, v1, Lcom/openfeint/internal/ui/WebViewCache$ManifestData;->objects:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_2

    .line 808
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->loadNextItem()V

    .line 810
    :cond_1
    return-void

    .line 802
    :cond_2
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;

    .line 803
    .local v0, item:Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;
    iget-object v2, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->hash:Ljava/lang/String;

    iget-object v3, p0, Lcom/openfeint/internal/ui/WebViewCache;->clientManifest:Ljava/util/Map;

    iget-object v4, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 804
    iget-object v2, p0, Lcom/openfeint/internal/ui/WebViewCache;->pathsToLoad:Ljava/util/Set;

    iget-object v3, v0, Lcom/openfeint/internal/ui/WebViewCache$ManifestItem;->path:Ljava/lang/String;

    invoke-interface {v2, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method private updateExternalStorageState()V
    .locals 5

    .prologue
    .line 433
    invoke-static {}, Lcom/openfeint/internal/Util;->noSdcardPermission()Z

    move-result v3

    if-eqz v3, :cond_0

    .line 434
    const-string v3, "WebViewCache"

    const-string v4, "no sdcard permission"

    invoke-static {v3, v4}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 436
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/WebViewCache;->setRootUriInternal()V

    .line 449
    :goto_0
    return-void

    .line 440
    :cond_0
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v2

    .line 441
    .local v2, state:Ljava/lang/String;
    const-string v3, "mounted"

    invoke-virtual {v3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 442
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v1

    .line 443
    .local v1, sdcard:Ljava/io/File;
    new-instance v0, Ljava/io/File;

    const-string v3, "openfeint"

    invoke-direct {v0, v1, v3}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 444
    .local v0, feintRoot:Ljava/io/File;
    invoke-virtual {p0, v0}, Lcom/openfeint/internal/ui/WebViewCache;->setRootUriSdcard(Ljava/io/File;)V

    goto :goto_0

    .line 446
    .end local v0           #feintRoot:Ljava/io/File;
    .end local v1           #sdcard:Ljava/io/File;
    :cond_1
    const-string v3, "WebViewCache"

    invoke-static {v3, v2}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 447
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/WebViewCache;->setRootUriInternal()V

    goto :goto_0
.end method


# virtual methods
.method markSyncRequired()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 711
    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->loadingFinished:Z

    .line 712
    iput-boolean v0, p0, Lcom/openfeint/internal/ui/WebViewCache;->globalsFinished:Z

    .line 713
    return-void
.end method

.method recoverInternal()Z
    .locals 2

    .prologue
    .line 716
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/openfeint/internal/db/DB;->recover(Landroid/content/Context;)Z

    move-result v0

    .line 717
    .local v0, success:Z
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->serverManifest:Lcom/openfeint/internal/ui/WebViewCache$ManifestData;

    .line 718
    if-eqz v0, :cond_0

    .line 719
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->getDefaultClientManifestFromAsset()Ljava/util/Map;

    move-result-object v1

    iput-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->clientManifest:Ljava/util/Map;

    .line 720
    iget-object v1, p0, Lcom/openfeint/internal/ui/WebViewCache;->clientManifest:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->isEmpty()Z

    move-result v1

    if-eqz v1, :cond_1

    const/4 v1, 0x0

    move v0, v1

    .line 722
    :cond_0
    :goto_0
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/WebViewCache;->markSyncRequired()V

    .line 723
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->sync()V

    .line 724
    return v0

    .line 720
    :cond_1
    const/4 v1, 0x1

    move v0, v1

    goto :goto_0
.end method

.method public final setRootUriInternal()V
    .locals 7

    .prologue
    .line 136
    const-string v5, "WebViewCache"

    const-string v6, "can\'t use sdcard"

    invoke-static {v5, v6}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 137
    iget-object v5, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getFilesDir()Ljava/io/File;

    move-result-object v0

    .line 138
    .local v0, baseDir:Ljava/io/File;
    new-instance v3, Ljava/io/File;

    const-string v5, "webui"

    invoke-direct {v3, v0, v5}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 139
    .local v3, rootDir:Ljava/io/File;
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, "/"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    sput-object v5, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    .line 140
    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "file://"

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    sget-object v6, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    sput-object v5, Lcom/openfeint/internal/ui/WebViewCache;->rootUri:Ljava/lang/String;

    .line 141
    new-instance v2, Ljava/io/File;

    const-string v5, "webui"

    invoke-direct {v2, v0, v5}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 142
    .local v2, inPhoneWebui:Ljava/io/File;
    invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z

    move-result v1

    .line 143
    .local v1, hasInPhoneData:Z
    if-nez v1, :cond_0

    .line 144
    new-instance v4, Ljava/lang/Thread;

    new-instance v5, Lcom/openfeint/internal/ui/WebViewCache$2;

    invoke-direct {v5, p0, v0}, Lcom/openfeint/internal/ui/WebViewCache$2;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/io/File;)V

    invoke-direct {v4, v5}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 149
    .local v4, t:Ljava/lang/Thread;
    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 153
    .end local v4           #t:Ljava/lang/Thread;
    :goto_0
    return-void

    .line 151
    :cond_0
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->clientManifestReady()V

    goto :goto_0
.end method

.method public final setRootUriSdcard(Ljava/io/File;)V
    .locals 9
    .parameter "path"

    .prologue
    .line 79
    new-instance v5, Ljava/io/File;

    const-string v6, "webui"

    invoke-direct {v5, p1, v6}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 80
    .local v5, webui:Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_0

    const/4 v6, 0x0

    move v1, v6

    .line 81
    .local v1, copyDefault:Z
    :goto_0
    if-eqz v1, :cond_1

    .line 82
    new-instance v3, Ljava/io/File;

    const-string v6, ".nomedia"

    invoke-direct {v3, p1, v6}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 84
    .local v3, noMedia:Ljava/io/File;
    :try_start_0
    invoke-virtual {v3}, Ljava/io/File;->createNewFile()Z
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 88
    :goto_1
    invoke-virtual {v5}, Ljava/io/File;->mkdirs()Z

    move-result v6

    if-nez v6, :cond_1

    .line 89
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/WebViewCache;->setRootUriInternal()V

    .line 133
    .end local v3           #noMedia:Ljava/io/File;
    :goto_2
    return-void

    .line 80
    .end local v1           #copyDefault:Z
    :cond_0
    const/4 v6, 0x1

    move v1, v6

    goto :goto_0

    .line 93
    .restart local v1       #copyDefault:Z
    :cond_1
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    sput-object v6, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    .line 94
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "file://"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    sget-object v7, Lcom/openfeint/internal/ui/WebViewCache;->rootPath:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    sput-object v6, Lcom/openfeint/internal/ui/WebViewCache;->rootUri:Ljava/lang/String;

    .line 95
    if-eqz v1, :cond_3

    .line 96
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    invoke-virtual {v6}, Landroid/content/Context;->getFilesDir()Ljava/io/File;

    move-result-object v0

    .line 97
    .local v0, baseDir:Ljava/io/File;
    new-instance v2, Ljava/io/File;

    const-string v6, "webui"

    invoke-direct {v2, v0, v6}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 98
    .local v2, inPhoneWebui:Ljava/io/File;
    invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z

    move-result v6

    if-eqz v6, :cond_2

    .line 102
    :try_start_1
    iget-object v6, p0, Lcom/openfeint/internal/ui/WebViewCache;->appContext:Landroid/content/Context;

    const-string v7, "manifest.db"

    invoke-virtual {v6, v7}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;

    move-result-object v6

    .line 103
    new-instance v7, Ljava/io/File;

    const-string v8, "manifest.db"

    invoke-direct {v7, v5, v8}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 102
    invoke-static {v6, v7}, Lcom/openfeint/internal/Util;->copyFile(Ljava/io/File;Ljava/io/File;)V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 107
    :cond_2
    :goto_3
    new-instance v4, Ljava/lang/Thread;

    new-instance v6, Lcom/openfeint/internal/ui/WebViewCache$1;

    invoke-direct {v6, p0, v2, v5, v0}, Lcom/openfeint/internal/ui/WebViewCache$1;-><init>(Lcom/openfeint/internal/ui/WebViewCache;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V

    invoke-direct {v4, v6}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 126
    .local v4, t:Ljava/lang/Thread;
    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    goto :goto_2

    .line 129
    .end local v0           #baseDir:Ljava/io/File;
    .end local v2           #inPhoneWebui:Ljava/io/File;
    .end local v4           #t:Ljava/lang/Thread;
    :cond_3
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->clientManifestReady()V

    .line 132
    invoke-direct {p0}, Lcom/openfeint/internal/ui/WebViewCache;->deleteAll()V

    goto :goto_2

    .line 85
    .restart local v3       #noMedia:Ljava/io/File;
    :catch_0
    move-exception v6

    goto :goto_1

    .line 104
    .end local v3           #noMedia:Ljava/io/File;
    .restart local v0       #baseDir:Ljava/io/File;
    .restart local v2       #inPhoneWebui:Ljava/io/File;
    :catch_1
    move-exception v6

    goto :goto_3
.end method
